//使用sigaction
#include <signal.h>
#include <iostream>
void sigcb(int signumber)
{
    std::cout << "收到了一个信号：" << signumber << std::endl;
}

int main()
{
    struct sigaction act;
    struct sigaction oact;
    act.sa_handler = sigcb; 
    act.sa_flags = 0;
    
    //想要定制sigmask(处理时忽略的信号)，就要使用信号集处理函数
    sigaction(SIGINT,&act,&oact);
    while(true);

    return 0;
}